[pull] main from MetaMask:main#536
Merged
Merged
Conversation
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
Wire Metro’s code-fence removal to **builds.yml** on GitHub Actions
while keeping Bitrise/local behavior unchanged.
**Why:** On GH Actions, build config (and thus which features are
enabled) comes from `builds.yml` via `apply-build-config.js`, which can
set `CODE_FENCING_FEATURES`. Metro previously only used
`METAMASK_BUILD_TYPE` and `METAMASK_ENVIRONMENT`, so code fencing did
not follow the same source of truth.
**What changed:**
- **GH Actions:** When `CODE_FENCING_FEATURES` is set, Metro uses that
JSON array for code-fence removal; `INCLUDE_SAMPLE_FEATURE` still adds
`sample-feature` when set.
- **Bitrise/local:** When `CODE_FENCING_FEATURES` is not set, behavior
is unchanged: features are derived from `METAMASK_BUILD_TYPE` +
`METAMASK_ENVIRONMENT` via `getBuildTypeFeaturesFromEnv()`.
- **Safety:** The env-based fallback returns new `Set` instances so
adding `sample-feature` (or other mutations) does not mutate shared
global sets.
- **Docs:** Comments and JSDoc clarify the “legacy” (Bitrise/local) vs
“GH Actions” paths.
**Scope:** Only `metro.transform.js` (no workflow or script changes in
this PR).
---
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Added code fencing for gh actions defined at builds.yml
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
checking code fencing in all builds ✅
main-rc
<img width="280" height="675" alt="main-test"
src="https://github.com/user-attachments/assets/75d11555-3f76-4f80-bb48-c6a45cb99d64"
/>
main-exp
<img width="280" height="675" alt="main-test"
src="https://github.com/user-attachments/assets/04487ad6-359c-448c-9660-f2e139f88dbf"
/>
main-test
<img width="280" height="675" alt="main-test"
src="https://github.com/user-attachments/assets/319eb592-691f-4abe-93f3-f3a0467ac0bc"
/>
main-beta
<img width="280" height="675" alt="main-test"
src="https://github.com/user-attachments/assets/c38416cb-706f-488f-a031-bcac2d811d8c"
/>
flask-test
<img width="280" height="675" alt="main-test"
src="https://github.com/user-attachments/assets/12224fd6-6ac2-4726-b7f4-43ca10ea2f59"
/>
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes the source of truth for code-fence feature gating in CI
builds, so misconfigured `CODE_FENCING_FEATURES` could include/exclude
fenced code unexpectedly across release flavors.
>
> **Overview**
> Metro’s code-fence removal now **prefers `CODE_FENCING_FEATURES` (JSON
from `builds.yml` via CI)** as the active feature set, falling back to
the prior `METAMASK_BUILD_TYPE`/`METAMASK_ENVIRONMENT` logic when unset.
>
> `builds.yml` expands code-fencing anchors to explicitly define `beta`
and `experimental` feature sets, and updates the `main-beta` and
`main-exp` build configs to use them; the Metro fallback path also now
returns fresh `Set` instances to avoid mutating shared feature sets when
optionally adding `sample-feature`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c474217. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Wei Sun <wei.sun@consensys.net>
…r merkl bonus claim… (#26234) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Added <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Adds analytics tracking for Merkl bonus claim transaction status updates. Tracking includes transaction and network context and claimed amount. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: added claim status event tracking for bonus claim flow ## **Related issues** Fixes: [MUSD-347: Add missing claim tracking ahead of release](https://consensyssoftware.atlassian.net/browse/MUSD-347) ## **Manual testing steps** ```gherkin Feature: Merkl bonus claim status event tracking Scenario: user submits and confirms a Merkl bonus claim Given user submits a Merkl bonus claim transaction on a supported network When the transaction status updates from approved to confirmed Then a claim bonus status updated analytics event is tracked for each status And the event includes transaction id, status, type, network chain id, network name, and claimed mUSD amount Scenario: user’s Merkl bonus claim does not complete Given user submits a Merkl bonus claim transaction When the transaction status becomes failed or dropped Then a claim bonus status updated analytics event is tracked with the final status And the event includes the same transaction and network context with claim amount when available ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> N/A ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** N/A - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Adds new analytics events that depend on decoding tx data and making an on-chain contract read, which could affect tracking reliability/performance if decoding/calls fail (though failures degrade to partial events). > > **Overview** > Adds MetaMetrics tracking for Merkl bonus-claim transaction lifecycle in `useMerklClaimStatus`, emitting `MUSD_CLAIM_BONUS_STATUS_UPDATED` on `approved`/`confirmed`/`failed`/`dropped` with transaction + network context and (when available) the claimed mUSD amount. > > Introduces `getUnclaimedAmountForMerklClaimTx` to decode claim calldata and read already-claimed amounts from the Merkl distributor contract, reuses it in the confirmations hook, and factors network-name resolution into a new shared `getNetworkName` utility (adopted by both claim and conversion tracking). Updates/extends unit tests to cover the new tracking, caching behavior, and network-name helper. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 478cc8b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )